package com.yzd.learnjava.http;

import java.io.IOException;

import com.yzd.learnjava.util.Print;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;

public class OkHttpDemo {

	public static void main(String[] args) {
		Request request = new Request.Builder().url("http://blog.csdn.net/itachi85")
				.method("GET", null).build();
		OkHttpClient client = new OkHttpClient();
		Call call = client.newCall(request);
		call.enqueue(new Callback() {
			
			public void onResponse(Call call, Response response) throws IOException {
				System.out.println(response.body().toString());
				
			}
			
			public void onFailure(Call call, IOException e) {
				
				
			}
		});

	}

}
